<?php

class Objeto extends Entidad {

    static $rules = [
        'nombre' => 'required|max:45',
        'descripcion' => 'required',
        'link' => 'required|url|max:100',
        'link_name' => 'required|max:100',
    ];

    function __construct() {
        parent::__construct();
        $this->guarded = array('id');
        $this->fillable = ['nombre','descripcion','slug','link','link_name','position','estado'];
        
        $this->tagModel = 'TagObj'; // Ej: TagRel
        $this->imageModel = 'Imageobj'; // Imagerel
        $this->tagsId = 'tag_objs.id'; // 'tag_rels.id'
    }
    
    public function relatos() {
        return $this->belongsToMany('Relato');
    }
    
}
